<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        /* 
        pc  4个模块
        pad 2个模块
        手机 1个模块
        */
    .wrap{
        overflow: hidden;
    }
    .item{
        /* 100 / 列数  width:100% / column  */
        float: left;
        width: 25%;
        height: 300px;
        margin-bottom: 20px;
    }
    .item:nth-of-type(2n+1){
        background-color: rebeccapurple;
    }
    .item:nth-of-type(2n){
        background-color: red;
    }
    /* <= 1080 适配pad端 */
    @media screen and (max-width: 1080px){
        .item{
            width: 50%;
        }
    }
    /* <= 640 适配手机端 */
    @media screen and (max-width: 640px){
        .item{
            width: 100%;
        }
    }
    </style>
</head>
<body>
    <div class="wrap">
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
    </div>
</body>
</html>